import service from './service';

/**
 * 调用Node.js服务
 * @param service_name 服务名
 * @param condition [condition={}] 参数
 * @returns 服务返回结果
 * @example nodejs(url, service_name, condition);
 */
export default async function nodejs<T>(service_name: string, condition: any) {
	const params = {
		...condition,
		modelid: 'custom::js_' + service_name
	};
	return await service<T>('dataservice.nodejs', params);
}
